Infection would be a leading possibility. I agree with the tests for STDs. If herpes is a concern, blood tests or smear test of any open lesions can be considered.
I would also consider prostatitis - which can evaluated with a digital rectal exam, prostatic massage, or transrectal ultrasound.
Surface conditions like dermatitis or fungal infections can be considered as well.
If infection has been ruled out, anatomical causes of the discomfort can be evaluated with a cystoscopy.
These options can be discussed with your urologist.
Followup with your personal physician is essential.
This answer is not intended as and does not substitute for medical advice - the information presented is for patient education only. Please see your personal physician for further evaluation of your individual case.
Kevin, M.D.
kevinmd_