Finite-volume effects due to spatially nonlocal operators