Smooth muscle and endothelial cells in the arterial wall are exposed to mechanical stress. Indeed blood flow induces intraluminal pressure variations and shear stress. An increase in pressure may induce a vessel contraction, a phenomenon known as the myogenic response. Many muscular vessels present vasomotion, i.e., rhythmic diameter oscillations caused by synchronous cytosolic calcium oscillations of the smooth muscle cells. Vasomotion has been shown to be modulated by pressure changes. To get a better understanding of the effect of stress and in particular pressure on vasomotion, we propose a model of a blood vessel describing the calcium dynamics in a coupled population of smooth muscle cells and endothelial cells and the consequent vessel diameter variations. We show that a rise in pressure increases the calcium concentration. This may either induce or abolish vasomotion, or increase its frequency depending on the initial conditions. In our model the myogenic response is less pronounced for large arteries than for small arteries and occurs at higher values of pressure if the wall thickness is increased. Our results are in agreement with experimental observations concerning a broad range of vessels.