We present results for the nucleon electromagnetic form factors, including the momentum transfer dependence and derived quantities (charge radii and magnetic moment). The analysis is performed using O(a) improved Wilson fermions in Nf=2 QCD measured on the CLS ensembles. Particular focus is placed on a systematic evaluation of the influence of excited states in three-point correlation functions, which lead to a biased evaluation, if not accounted for correctly. We argue that the use of summed operator insertions and fit ansatze including excited states allow us to suppress and control this effect. We employ a novel method to perform joint chiral and continuum extrapolations, by fitting the form factors directly to the expressions of covariant baryonic chiral effective field theory. The final results for the charge radii and magnetic moment from our lattice calculations include, for the first time, a full error budget. We find that our estimates are compatible with experimental results within their overall uncertainties.