UTIs after sex

Okay...this is a little embarrassing but my boyfriend and I recently started having sex, and I have been getting UTIs a few days after having intercourse. I don't know why, because I pee before and after sex. HELP! I need to know why this happens. Getting a UTI is the worst experience ever.