My friend had the same problem a few weeks ago. An explanation for such a phenomona could be that Windows restarts the computer whenever a system failure occurs. Therefore, if something was to induce a system failure during your shutdown process, Windows would restart the computer instead of shutting it down. To see if this is the problem go to:
My Computers>Properties>Advanced>Settings (under Startup and Recovery)>uncheck Automatic Restart
This would stop Windows from restarting whenever a system failure occurs. If the computer stops rebooting after this, than you know you have something causing your system to fail. At least your computer will shut down though!