A nonlinear dynamical system related to the contact Lie algebras