You had very little risk since there was no penetration.
You wouldn't get gon, chlamydia, MGen, HIV, hep B, trich, or NGU from this. That requires penetration.
The chance for syphilis, herpes and HPV is very, very, very low. If it was a brief touch, like a brush against her vagina, there is no risk.
Either this is all anxiety or something else entirely is going on.
Pain at the tip of your penis and in your testicles could indicate prostatitis. It could also be from dehydration.
Increase your water, decrease or cut out alcohol and caffeine, and see how you feel. If it doesn't improve, see a urologist.
Guilt does not equal risk.