The night side ionosphere of Mars is known to be highly variable: essentially nonexistent in certain geographic locations, while occasionally nearly as strong as the photoionization-produced dayside ionosphere in others. The factors controlling its structure include thermospheric densities, temperatures and winds, day-night plasma transport, plasma temperatures, current systems, solar particle events, crustal magnetic fields, and electron precipitation, none of which are adequately understood at present. Using a kinetic Monte Carlo approach called Mars Monte Carlo Electron Transport (MarMCET), we model the dynamics of precipitating solar wind electrons on the nightside ionosphere of Mars to study the effects of these last two factors on ionospheric density and structure. We calculate ionization rate profiles and, using simple assumptions concerning atmospheric chemistry, also calculate electron density profiles, total electron content, and equivalent ionosphere slab thickness. We present the first model investigation of the coupled effects of crustal magnetic field gradients and precipitating electron pitch angle distributions (PADs). Including such effects, particularly in cases of nonisotropic PADs, is found to be essential in accurately predicting ionization rate and electron density profiles: peak ionization rates can vary by a factor of 20 or more when these effects are included.