Restoring iPhone as a new iPhone but backing up contacts
Yes, as long as your contacts are synced with iCloud, you can reset your phone without losing them. If you can see them on iCloud.com, they are synced.

First make sure you have a current iCloud backup of your phone before resetting. You can backup manually by going to "Settings > iCloud > Storage &amp; Backup > Back up Now".

Second, make sure your contacts are being synced "Settings > iCloud > Contacts" button turned ON (green showing). 

Now, after you reset your phone (Settings > General > Reset > Erase All Content and Settings), you can set-up the phone as a "new phone" (i.e. not from your iCloud backup). Add your iCloud account and turn on Contacts syncing (switch button to green). Your contacts will then be downloaded from iCloud onto your fresh iPhone installation.