When I did a factory reset on my GS4 I went to Settings, Accounts, you'll see this
Since I have a Samsung account I choose cloud and you can back up there. Then go back and choose Backup and reset.
You can back up there too and from there also do the factory reset.
Don't forget to save all documents, videos and pictures into the SD card.
Make sure you get the SD card out of the phone before the factory reset.
Sent From Inside The TARDIS in a Galaxy S4 Away!