The Samurai as we think of them originally developed as horse soldiers, cavalry. Those who fought on foot, ashigaru, can technically be classified as members of the Samurai class but that's a discussion for another day. Now, the katana (originally called uchigatana) didn't come into existence until just about the 15th century (circa the 1390s specifically). It's predecessor, the tachi, was effectively a cavalry saber and was developed sometime between 900 and 1100AD. Curved blades were far more efficient than the straight swords of the ashigaru when wielded on horseback, where the curve of the blade adds considerably to the downward force of the cutting motion. Therefore, on a cavalry dominated battlefield, it only made sense to have a significantly curved blade (the tachi also had a proportionally long handle to counterbalance the sword for one-handed use).
The development of the uchigatana symbolized a change in warfare tactics. When the Sengoku Jidai (Warring States Period) broke out in the 15th century, Samurai increasingly found a need for close-quarters and dismounted fighting. The deep curve and long handle made the tachi cumbersome when used on foot and gradually the sword was condensed to what we know today as a katana. Because of their effectiveness of the katana, many tachi were in fact shortened during the 15th to 17th centuries to keep up with the demand.
Upon entering the Edo period in 1603AD, combat further developed in an unforeseen direction. Because war itself was outlawed, the need for weapon and armor development came to a halt yet an entire art was created out of necessity. The study of iai, or drawing from the saya and cutting in a single motion, was honed during the Edo period essentially as a "swordsman's self defense" system. Should you come under sudden attack, you needed to be able to draw your sword and neutralize your assailant instantly, and the curve of the blade was found beneficial in creating such a motion.
Of course, I am only scratching the surface of such a deep topic. There is so much more to be discussed, and this is certainly not meant to weigh in on the katana vs. European longsword debate. Weapons are inherently developed for the type of fighting they are to be used in and the type of enemy they are to face. It is entirely possible that had plate armor developed in Japan, we would've seen similar development of straight, double edged swords as they had in Europe (as well as anti-armor weapons such as war hammers and maces). A straight sword has better thrusting capability than a curved one, simply because all of the force is concentrated on a small area of contact, and when confronted with plate armor, you're not slicing through it anytime soon.
However, on the battlefields of feudal Japan or on the streets of Edo, the katana served countless Samurai well and it greatly has it's curved design to thank for that.