Make sure the cable you use to connect your iPhone with the computer is working correctly. If possible, try a different one. Also try restoring on a different computer, and make sure the network connection is working properly. Use a different USB port when trying to restore again.
Also, confirm your security software and settings on the computer allow connecting to Apple's servers during the process.
If you iPhone stuck in recovery mode and your computer can not detect your iPhone, I think it is a hardware issue. If it is a software issue your iPhone can still be recognize by your iTunes and it will pop-up messages to tell you your iPhone is not in normal mode and you need to restore it with iTunes. Just like J.A said, you need to make sure your USB cable is all right. If you have another one, try to connect your iPhone to your computer with the new one. If it is not the problem of your cable, I think you need to book a help from the Apple Store near your home.
Or can you just reboot your iPhone pressing both home button and sleep/weak button?