Apply twisting pressure to the iPhone at the bottom left and top right corners, meanwhile pressing the button. It should then work.
I then tried just locking the screen and holding the phone in such a twisted position for a while, after which the volume button did work for a while without having to continually hold the phone in this manner. However, I so far have been unable to get it to stay this way. It appears the case has bent just enough to cause a problem.
Unfortunately, I am outside the 1-year warranty that comes with the phone.