Everything would be erased, that's why you'd do the backup first.
When you restore the phone from your backup, everything will go back except for music and apps etc. that can be redownloaded from Apple.
Obviously if you set up the phone as new, then nothing you backed up will go back onto the phone.
I suggest moving all contacts, calendars etc. to iCloud anyway, so all you have to do is sign into iCloud on your iPhone and BOOM your contacts magically appear.