You should definitely go to see your primary care doctor
about this as soon as possible!
First of all, most of the time when the penis hurts with an erection, this is due to strain or overuse. For example, if you have recently been having a lot of vigorous sexual intercourse, or if you have been masturbating more than usual, this is the most likely explanation for the pain, and, if so, things tend to get better over a few days with some rest.
However, the fact that you also think the penis might be bent to one side is more concerning, as this suggests the possibility of a condition known as Peyronie's disease. This is a condition in which an area of scar tissue forms on the side of the penis, gradually causing the penis to bend to one side and causing pain with erection that can be severe at times.
Peyronie's disease needs to be diagnosed early, because if it is not treated, it can lead to serious sexual dysfunction
. If your primary care doctor things that your examination is consistent with Peyronie's disease, they will make a referral to a urologic specialist for more evaluation and treatment.