How do I keep my session when I reboot in OS X?
ReLaunch does what you want. Also see a similar question on SuperUser.

The only major limitation of Relaunch is it does not (yet) support Spaces (virtual desktops).