Localization of autonomous underwater vehicles is essential for underwater exploration, environmental monitoring, and infrastructure inspections, as only a few examples. As wirelessly transmitted data cannot be used in underwater navigation, and equivalent sensors are costly and not readily deployable, the use of cameras as a localization aid offers an attractive alternative. Nonetheless, the utilization of cameras for underwater navigation is hindered by medium-induced visual deterioration and refraction of the incident ray. While most research has been focusing on addressing the radiometric deterioration effects, we demonstrate that the introduction of a physically aware model of the refraction effect can significantly improve the platform localization. Specifically, we develop a refraction-aware continuous formulation of the egomotion model, which computes the translational and rotational velocities using optical flow measurements. We also demonstrate that a linear model can be reached despite the nonlinear ray's path. Results show an improved navigation solution echoed by a significant reduction in the drift with more than tenfold improvement in the estimated position and angular quantities compared to state-of-the-art methods. They demonstrate the benefit of exact modeling in underwater navigation.