Entanglement in a two-qubit Ising model under a site-dependent external magnetic field