The ionosphere is the propagation medium for radio waves transmitted by an over-the-horizon radar (OTHR). Ionospheric parameters, typically, virtual ionospheric heights (VIHs), are required to perform coordinate registration for OTHR multitarget tracking and localization. The inaccuracy of ionospheric parameters has a significant deleterious effect on the target localization of OTHR. Therefore, to improve the localization accuracy of OTHR, it is important to develop accurate models and estimation methods of ionospheric parameters and the corresponding target tracking algorithms. In this paper, we consider the variation of the ionosphere with location and the spatial correlation of the ionosphere in OTHR target tracking. We use a Gaussian Markov random field (GMRF) to model the VIHs, providing a more accurate representation of the VIHs for OTHR target tracking. Based on expectation-conditional maximization and GMRF modeling of the VIHs, we propose a novel joint optimization solution, called ECM-GMRF, to perform target state estimation, multipath data association and VIHs estimation simultaneously. In ECM-GMRF, the measurements from both ionosondes and OTHR are exploited to estimate the VIHs, leading to a better estimation of the VIHs which improves the accuracy of data association and target state estimation, and vice versa. The simulation indicates the effectiveness of the proposed algorithm.