An electrodynamic model of the solar wind interaction with the ionospheres of Mars and Venus