A 28-year-old nulligravid woman has had increasingly severe dysmenorrhea over the past 2 years and dyspareunia and pain with defecation for 6 months. She has been unable to conceive for 2 years Pelvic examination shows a fixed, tender, retroverted uterus, nodularity of the uterosacral ligaments, and tender adnexa bilaterally; there is a 5-cm, tender, cystic, right adnexal mass, A pregnancy test is negative. Select the most likely diagnosis.