Entanglement hamiltonian and entanglement contour in inhomogeneous 1D critical systems