A man raped a "vulnerable" 18-year-old woman at a park after she had already been attacked by his friend, a court has heard.