Finite groups in which all nonlinear irreducible characters have the same codegree