Planck 2013 results. XXII. Constraints on inflation