Second-order absorbing boundary conditions for the wave equation in a rectangular domain