The BEC–BCS crossover in ultracold Fermi gases beyond the contact-potential approximation