Magnetic exchange parameters and anisotropy of the quasi-two-dimensional antiferromagnet NiPS3