Hello and welcome to e health forum.
This is a common reaction in any new relation when sexual intercourse is attempted early on. This is usually due to psychological issues could be due to result in performance anxiety and lack of confidence.
The best way, to solve this issue would be a few sessions of cuddling up with your partner, naked with no actual intercourse, and exploring each others body and finding what excites each other.
The best sexual experience is when the couple is confident with their own body and sexuality as well as confident and are having a healthy sexual attraction towards their partner. When such a confidence builds in, then you will find that your issues will be solved.
In case you are able to have a proper erection with masturbation and by oral stimulation (oral sex) there should be no major medical conditions causing erectile dysfunction.
You might consult your doctor or a sexologist, who can prescribe you medications like cialis and viagra, which when used for a couple of times will help you gain your confidence.
I hope this helps.