Creating node and user with one form
The Create &amp; Register module does this for you if you don't mind using a contrib module. From the project page...


  This module creates a "lazy registration" which means that the user
  creates the content first and after this logs in or registers to the
  site.
  
  Process
  
  
  anonymous user creates a content 
  the user will be redirected to the login page (if you set it on the settings form) after he finished the node creation 
  the user registers or logs in 
  the created node(s) will be assigned to the user after logging in