Planck 2013 results. XXX. Cosmic infrared background measurements and implications for star formation