We present a novel method of modeling the contact between a metal and a two-dimensional semiconductor. Using Au on MoS2 as an example, we self-consistently solve the Schrödinger and Poisson equations and obtain the charge density in the contact. We consider open boundary conditions using the quantum transmitting boundary method and model the electron current through the contact region. We then investigate the effect of effective Schottky barrier height, electrostatic doping, and length of the overlap region on the contact resistance in a top contact geometry. By using data from experiments or from ab initio calculations for the fitting of parameters, such as the effective Schottky barrier height, the model can be used to efficiently obtain the contact resistance and, therefore, the quality of the contact. Furthermore, we investigate the effect of sampling of the Brillouin zone in the transverse direction on the numerical calculation of key quantities, such as contact resistance and free charge density. Additionally, we show that the boundary conditions applied to the Poisson equation during the calculation of the free charge density have a significant impact on the calculated contact resistance and that the impact is more pronounced in heterostructures with a larger Schottky barrier. We found that the contact resistance may be significantly underestimated, by up to one order of magnitude, when the height of the simulation domain is not large enough.