The level set method is one of the most successful methods for the simulation of multi-phase flows. To keep the level set function close the signed distance function, the level set function is constantly reinitialized by solving a Hamilton-Jacobi type of equation during the simulation. When the fluid interface intersects with a solid wall, a moving contact line forms and the reinitialization of the level set function requires a boundary condition in certain regions on the wall. In this work, we propose to use the dynamic contact angle, which is extended from the contact line, as the boundary condition for the reinitialization of the level set function. The reinitialization equation and the equation for the normal extension of the dynamic contact angle form a coupled system and are solved simultaneously. The extension equation is solved on the wall and it provides the boundary condition for the reinitialization equation; the level set function provides the directions along which the contact angle is extended from the contact line. The coupled system is solved using the 3rd order TVD Runge-Kutta method and the Godunov scheme. The Godunov scheme automatically identifies the regions where the angle condition needs to be imposed. The numerical method is illustrated by examples in three dimensions.