Quadratic stability of a class of switched nonlinear systems