A high-order nonlinear envelope equation for gravity waves in finite-depth water