Hi there!
Well, without a detailed clinical evaluation it would be difficult to determine the cause of your symptoms. While mild discomfort would not be abnormal during sexual activity, due to increased blood flow to the genitals; with frank pain, possibilities that may need to be considered include GU infections, inflammations, neuro-muscular causes, vascular issues, medication side effect etc. I would suggest getting this evaluated by a urologist. After a specific cause is identified, it can be managed accordingly.
Hope this is helpful.
Take care!