Apple's mobile devices (iPhones and iPads) are not designed to be shared, nor are you supposed to share Apple Music subscriptions unless done under Family Sharing with a family level subscription (in which case you still do not sign in with somebody else's account).
You should go through all the photos and all the contacts on your device and remove those that do not belong to you. I have never done what you did and do not know the extent that data transfer may have happened. This may even have extended to passwords. You and your friend should change passwords on all accounts. Conceivably, anything using iCloud could see merged data.