Fitting synthetic spectral energy distributions (SEDs) to the multiband photometry of galaxies to derive their star formation rates (SFRs), stellar masses, ages, etc. requires making a priori assumptions about their star formation histories (SFHs). A widely adopted parametrization of the SFH, the so-called τ models where SFR ∝ e−t/τ is shown to lead to unrealistically low ages when applied to a sample of actively star-forming galaxies at z∼ 2, a problem shared by other SFHs when the age is left as a free parameter in the fitting procedure. This happens because the SED of such galaxies, at all wavelengths, is dominated by their youngest stellar populations, which outshine the older ones. Thus, the SED of such galaxies conveys little information on the beginning of star formation (SF), i.e. on the age of their oldest stellar populations. To cope with this problem, besides τ models (hereafter called direct-τ models), we explore a variety of SFHs, such as constant SFR and inverted-τ models (with SFR ∝ e+t/τ), along with various priors on age, including assuming that SF started at high redshift in all the galaxies in the test sample. We find that inverted-τ models with such latter assumption give SFRs and extinctions in excellent agreement with the values derived using only the UV part of the SED, which is the one most sensitive to ongoing SF and reddening. These models are also shown to accurately recover the SFRs and masses of mock galaxies at z∼ 2 constructed from semi-analytic models, which we use as a further test. All other explored SFH templates do not fulfil these two tests as well as inverted-τ models do. In particular, direct-τ models with unconstrained age in the fitting procedure overestimate SFRs and underestimate stellar mass, and would exacerbate an apparent mismatch between the cosmic evolution of the volume densities of SFR and stellar mass. We conclude that for high-redshift star-forming galaxies an exponentially increasing SFR with a high formation redshift is preferable to other forms of the SFH so far adopted in the literature.