This article introduces the integration of valve trains with variable phase control into the simulation of timing drives in combustion engines. The calculation of the dynamics of the timing chains is realized by a step size controlled time integration scheme, allowing to define rigid-body contacts. For the simulation of the valve trains, a mathematical formulation for general multibody systems with hydraulics and control systems is presented, wherein constraints can be defined as set valued laws and the time integration of the system is realized by a time-stepping integrator. For the coupling of the valve trains with the timing chains a higher order cosimulation algorithm is applied and general interfaces in both of the systems are introduced. A simulation model for a cylinder head with timing chain, and hydraulic vane cam phasers on the intake and exhaust cam shafts is decribed and simulation results of the system are presented.