An extended class of orthogonal polynomials defined by a Sturm-Liouville problem