Effect of viscoelasticity on the rotation of a sphere in shear flow