iOS 8 Update Not Working

I currently have a jailbroken iPhone 5s and I want to get rid of the jailbreak and update to iOS 8. I plug my phone into my computer, go into it in iTunes, click restore, then it asks me a few pop up boxes and I accept and click restore and update. But then it says "contacting the update server..." and stays loading it forever. How do I get past this so it will download? Or is there any other way to do this?