Considered as the free accessible and suitable solution for positioning in urban areas, Global Navigation Satellite Systems (GNSS) have been widely used these recent years in a wide spectrum of applications. However, signal blockage, non-line-of-sight (NLOS) multipath interferences and signal degradation affect the system performance and represent the major hurdles of GNSS in it course of adoption as a main localization technology in urban environments. Many approaches have been employed to constructively use these degraded signals in order to reduce positioning errors. Following this vision, we propose in this paper a joint estimation method of the position and the bias for measurement correction. This formulation leads to an ill-conditioned estimation problem. In this work, we apply a regularized robust estimation framework to this problem of NLOS mitigation for GNSS positioning in harsh areas. We derive the optimal regularization matrix by minimizing the total Mean Square Errors (MSE) of the considered model. The performance of the proposed method is assessed using real GNSS data collected in a dense urban area in Toulouse City, showing improvements in comparison to some existing methods.