The ionosphere of Mars is expected to be significantly affected by the solar wind because Mars does not possess a significant intrinsic magnetic field which deflects the solar wind. Despite a number of plasma measurements made near Mars, the nature of the solar wind-Mars interaction has not yet been fully understood. In order to self-consistently study the solar wind interaction with the ionosphere of Mars, a two-dimensional MHD model has been developed with an emphasis placed on the structure of the ionosphere of Mars. It is found that the modeled electron density profile in the upper ionosphere strongly depends on the solar wind dynamic pressure as well as the solar zenith angle. The ionosphere in the model tends to have an ionopause-like sharp drop of the electron density at some altitude for realistic solar wind dynamic pressures. Such behavior is not consistent with most of the observed electron density profiles, which exhibit relatively large and constant scale height in most of the dayside region. While the observed electron density profiles of the Venus ionosphere have been reproduced reasonably well by ionospheric models as well as recent three-dimensional MHD models, the electron density profiles of the Martian ionosphere have not been successfully reproduced by theoretical models including this study. This fact implies that processes not present in the Venus ionosphere, such as crustal magnetic fields and the rotation of the planet, may have significant effects on the structure and the dynamics of the ionosphere of Mars.