Another way to do it without hacking the registry, which can be scary for some users), is to follow the instructions on the following website:
http://weblogs.asp.net/jgalloway/archive/2006/02/11/438009.aspx
I've pasted in the main parts of it, in case the link goes dead (but no nice pictures though):
- Go to Start -> Run(or in Vista and 7 simply press the windows orb)
- Type: gpedit.msc
- Expand Local Computer Policy / Computer Configuration / Administrative Templates / Windows Components / Windows Update
- Double-click "No auto-restart for scheduled Automatic Updates installations"
- Select "Enabled", then OK. Close the Group Policy configuration program.
That should stop it autorestarting.