An extension of a multiplicity theorem by Ricceri with an application to a class of quasilinear equations