Conservative methods for ordinary differential equations on quadratic groups