CFHTLenS: the relation between galaxy dark matter haloes and baryons from weak gravitational lensing