If you have your contacts backed up to iCloud, it will sync your contacts, when you restore. I believe it usually asks you if you would like to back up your contacts when you set up iCloud.
Originally Posted by ricnmar
The first thing you do is set up your account on iCloud.com. (Just sign in with your iTunes account)
The second thing is on your iDevice, you sign into iCloud on your device. (Settings>iCloud)
The third thing is turning on whatever you want Mail, Contacts, Calender, Reminder, etc. etc. The good thing of turning on iCloud is you can find your iDevice from your computer. Just in case it is ever stolen, or lost, you can sign onto iCloud from your computer and just see where you left your iDevice.
I have done this for my Mom and Pop, just so they can have their iPhone's backed up and if something were to happen to their devices. We have everything backed up and what not. Just to be safe.