I've restored my iPhone 6s plus to factory settings, and set up as a new phone but my photos and contacts are still there?

I'm trying to get it out of stuck in headphones mode, I've tried everything else, so the man in Apple shop. Said to restore it to a brand new phone, which I have done but my photos are still there and my contacts, texts and music have gone though?

Did you log into your iCloud account? It's possible all of them are on your iCloud and that's what you're seeing

Apple have rather confusing terminology and use "restore" in several different ways for different things that have totally different effects on the phone or tablet.

The only fix for a corrupted firmware bug is a total re-flash of the operating system.
That's done in what Apple call DFU mode - device firmware update.

In principle the phone flash memory (other than the boot page) is totally overwritten with an image of the OS as it is on a new, blank phone. That tends to clear problems nothing else can.

See here for more:
https://www.imore.com/...d-dfu-mode

If you signed into your Apple ID then those details would be synced back on, so that's not because the restore didn't work.

It is either pulling it from the cloud account or from your sim card or SD card in it.