The rubbing during sex can cause bacteria from the genital area and anus to come into contact with the urethra. This can move toward the bladder and trigger cystitis. In addition, vaginal dryness during sex can lead to inflammation of the mucous membranes, making them more vulnerable to infection.