Magnetotransport properties of a semiconductor nanowire with a constriction have been studied within the Landauer-Büttiker formalism in the presence of the axially oriented magnetic field at low temperatures. The one-electron quantum states in the nanowire have been calculated within the adiabatic approximation which takes into account the three-dimensional structure of the nanowire and allows us to study the effect of the transverse quantum states on the electronic current. The calculated current-voltage characteristics exhibit well pronounced peaks that result from the enhancement of the electron transmission by the Stark resonant states formed in the triangular quantum well near the constriction. The effect of the Stark resonances is clearly manifested in the magnetoresistance as a function of the drain-source voltage. The calculated magnetoresistance exhibits two interesting features: (i) rapid jumps at certain voltages, caused by the enhancement of the electron transmission by the Stark resonances, (ii) changes of sign that stem from the magnetic-field induced changes of the current-voltage characteristics slope. The influence of the constriction parameters (radius, length, smoothness of the potential barrier, position of the constriction in the nanowire) on the electronic current has also been analyzed. Since the effective potential barrier created by the constriction in the nanowire is similar to that generated by the negatively charged gate surrounding the nanowire, the presented results can also be applied to the description of the magnetoresistance in the gated nanowires.