Although not specifically mentioned in the Laws any more, this is considered to be Unsporting Behaviour. Back in 1993 Law 12 had as an International board decision note 4:
"If a player leans on the shoulders of another player of his own team in order to head the ball, the referee shall stop...