We determine the continuum limit of the curvature of the pseudocritical line of QCD with $n_f$=2+1 staggered fermions at nonzero temperature and quark density. We perform Monte Carlo simulations at imaginary baryon chemical potentials, adopting the HISQ/tree action discretization, as implemented in the code by the MILC collaboration. Couplings are adjusted so as to move on a line of constant physics, as determined in Ref.~cite{Bazavov:2011nk}, with the strange quark mass $m_s$ fixed at its physical value and a light-to-strange mass ratio $m_l/m_s=1/20$. The chemical potential is set at the same value for the three quark species, $mu_l=mu_sequiv mu$. We attempt an extrapolation to the continuum using the results on lattices with temporal size up to $L_t=12$. Our estimate for the continuum value of the curvature $kappa$ at zero baryon density, $kappa=0.020(4)$, is compared with recent lattice results and with experimental determinations of the freeze-out curve.