Moon was produced by a head-on collision between Earth and a forming planet