For Contacts, you up-sync your contacts to iCloud Contacts (
http://apple.co/2zcPUVH). So when you log into your iCloud account after wiping your phone, your contacts will sync down.
For Whatsapp messages, you can back them up to iCloud too (
http://bit.ly/2zbGZE1), provided you have enough storage space.
To clean install iOS11.1, first download the correct .ipsw file for your phone. Then connect your phone to iTunes and follow the steps -
http://bit.ly/2zfbadH
After the installation is complete, set up your phone as a new device, log back into your iCloud account and download your apps again from the App Store.
Warning: this procedure will erase the contents of your phone and install a fresh copy of iOS. So back up any files, photos, music, movies, etc. before doing this. It's a pain the arse, but you only need to do this once, until iOS 12 comes out.