A hydrodynamical halo model for weak-lensing cross correlations