Had the same problem on my iPhone 4S.
Each time i tried to update to iOS 7, it kept coming up with error 4013 (after about 2 minutes of waiting for the iPhone).
After trying it 7 times, i noticed a little icon in the Windows taskbar (each time, right after iTunes said it would prepare the phone for the restore process), which appears when Windows installs a driver for a usb-connected device. In stead of installing the driver, it showed a tiny red circle with a white "X" in it.
Clearly, Windows was unable to install the driver, thus iTunes couldn't continue to update my phone.
This is how I fixed it:
Uninstalled iTunes and rebooted my computer.
Downloaded iTunes and installed it, then rebooted my computer.
Started iTunes and connected my phone, using a different cable (to rule out any cable related issues).
Clicked the "Restore" button in iTunes.
This time the driver installed succesfully and iTunes, immediately, started the restore process.
My phone is now updated to iOS 7, and working fine!
Hope this helps other people with the same problem!