I did a few years back with my partner. I freaked out that it surely physical and that was it, I never gonna have sex again. Turns out it was psychological. It started because I hated the guy and did not wanted to go bed with him, but after I failed in bed a few times this turned into a contant worry and that later one was what blocked my future attempts with others as well. Time heals everything, I broke up with the guy and the whole problem went away after a few months. You could have a physical problem, there are risk factors listed on the net to help you decide if you should visit your doctor or not, but most of the time it is all in your head and I don't mean that in a detrimental way.
I think it might just be a psychological thing... I don't have much experience in sex but I have heard about this before... but I think it is just a mental thing...