Is it possible to restore my phone as a new iphone and recover all of my data?

My iPhone 4s has recently got some problems so I have to take it in to get it fixed, but it's jailbroken, so i have to restore it completely first, not just restore from backup. I have tons of pictures and contacts i don't want to lose, and iCloud doesn't store all of them, so is it possible to somehow save all of them then put them back on my iPhone after it restores?

Apple can tell it was jailbroke if you restore 100 times or not.
your warranty will be void and you will need to pay for any repairs

You can backup your pictures using dropbox for example.
Well you can reset your iPhone to a new iPhone. Just connect it to iTunes. Click on your iDevice. Then it'll say something like "erase" etc. Click on it. Then it will ask if you wanna use your iCloud data or restore it to 100%. Then click on full restore. Now it is restoring. Good as new!