According to TeensHealth, urinary tract infections (UTIs) are not contagious; however, bacteria that causes infection can enter the urethra during sexual intercourse. Sexually transmitted diseases such as chlamydia are contagious and can cause urethral discomfort and inflammation, symptoms that are similar to those of a UTI.
Mayo Clinic explains that urinary tract infections occur when bacteria found in the gastrointestinal tract enter the urethra and multiply. The locations of the anus and urethra in women makes it easy for bacteria to spread between the two areas. Infections that remain in the urethra are referred to as urethritis. Urinary tract infections that move into the bladder are referred to as cystitis.