Do not restore from a backup. This would defeat the purpose of restoring. Setup as new. You won't lose any photos(if photos is on in iCloud) and you won't lose any contact(so long as Contacts is toggled on in Settings>iCloud).
If you restore from a backup your just young to reinstall whatever "problem files" are causing your issue...because everything is stored in the backup.
You should only restore from a backup that was taken when the device had no problems at all.