How to render nodes + background image?
Connect the last node in your tree of nodes to both Compositor node and Viewer node, because the node which is connected to either Compositor or Viewer will be one acessible for preview in result. 

Basically, Viewer allows you only to preview the result which you're working on, while Compositor will make this result to be actually rendered. 



At the moment you have your original image connected to Compositor node which is why you get that not expected result. Also you have your composited image connected to Viewer node, and that's why you can preview eveything nicely.

Read more on difference between these nodes in wiki or in this related question: What is the difference between Viewer and a Compositor node.