Amazon agrees to pay N.J. sales tax