It seems that during sex there might be more friction or rough sex might have caused some irritation, bruises and minor injury
to local part giving rise to infection.
Apply antibiotic cream locally.
Clean local part clean, dry and airy.
If swelling and more pain is continued, consult your doctor and go for one antibiotic medicine course.
Ok and take care.