Planck 2013 results. XII. Diffuse component separation