it usually means the connection to the update server has some problems.
Connection through Kies on your computer is more resilent. So, you can download and install Kies to your PC. Now you can start Kies on your PC and then connect your S4 to the PC using the USB cable. You can then backup and update your S4.