We present constraints on cosmological parameters using number counts as a function of redshift for a sub-sample of 189 galaxy clusters from the Planck SZ (PSZ) catalogue. The PSZ is selected through the signature of the Sunyaev-Zeldovich (SZ) effect, and the sub-sample used here has a signal-to-noise threshold of seven, with each object confirmed as a cluster and all but one with a redshift estimate. We discuss the completeness of the sample and our construction of a likelihood analysis. Using a relation between mass M and SZ signal Y calibrated to X-ray measurements, we derive constraints on the power spectrum amplitude sigma(8) and matter density parameter Omega(m) in a flat Lambda CDM model. We test the robustness of our estimates and find that possible biases in the Y-M relation and the halo mass function are larger than the statistical uncertainties from the cluster sample. Assuming the X-ray determined mass to be biased low relative to the true mass by between zero and 30%, motivated by comparison of the observed mass scaling relations to those from a set of numerical simulations, we find that sigma(8) = 0.75 +/- 0.03, Omega(m) = 0.29 +/- 0.02, and sigma(8)(Omega(m)/0.27)(0.3) = 0.764 +/- 0.025. The value of sigma(8) is degenerate with the mass bias; if the latter is fixed to a value of 20% (the central value from numerical simulations) we find sigma(8)(Omega(m)/0.27)(0.3) = 0.78 +/- 0.01 and a tighter one-dimensional range sigma(8) = 0.77 +/- 0.02. We find that the larger values of sigma(8) and Omega(m) preferred by Planck's measurements of the primary CMB anisotropies can be accommodated by a mass bias of about 40%. Alternatively, consistency with the primary CMB constraints can be achieved by inclusion of processes that suppress power on small scales relative to the Lambda CDM model, such as a component of massive neutrinos. We place our results in the context of other determinations of cosmological parameters, and discuss issues that need to be resolved in order to make further progress in this field.