To begin with, unless we're talking about masturbation, we need access to a partner. Early ventures into space were not conducive to sexual activity. The first human space flights were one man flights. When, in 1963, the first woman cosmonaut went into space, she flew with another man, but she was in one-person capsule and he was in another, and the flight did not include any docking maneuvers. Through the 1970s, crews contained only men until Salyut 7, which was a mixed crew (1982). 1983 Sally Ride, since then mixed crews common, and in 1992, a married couple. Did any of these flights include sex in space? Who knows? There's no official confirmation. Is it possible? Theoretically yes, but difficult: microgravity, effects on physiology, radiation, psychological effects. Read on...
Why is space a terrible place for sex? Sex desire is likely to be curbed by the physiological effects of space flight, such as space adaptation syndrome (onset within 2 hours, and persisting up to a week, experienced by 2/3 trained crew and 85% of those less well trained; includes headache, nasal congestion, dizziness, nausea, vomiting without warning); anxiety about the dangers of space, busy work schedule, lack of privacy. Male rats experience a decrease in testosterone levels (to less than 20% normal) and this is likely true also for human; anemia, fluid loss, reduced autonomic nervous system function, especially sympathetic tone (needed for climax in both men and women); reduction bone and muscle mass; sex in space may require significantly more energy and higher risk of fractures.
Normal sexual intercourse uses 2-3 METs; at climax increased to 4 METs (about the energy of walking 3-4 mph). Heart rate rises to 130 pbm, blood pressure to 170-180 systolic. In a stressful environment and an unfamiliar partner, the expenditure can be much higher (5-6 METs). The deconditioning, fluid shifts, and loss of autonomic tone due to microgravity may further increase energy expenditure, heart rate and blood pressure during intercourse to potentially dangerous levels. Normally, risk of myocardial infarction or death is 1-2 per million; we don't know risk in space environment.
Astronauts are screened for STDs, but this might not be true for space tourists. Microgravity results in a mild reduction in immune function, thus increasing the risk of contracting an STD.