We consider a smooth Poisson affine variety with the trivial canonical bundle over complex numbers. For such a variety the deformation quantization algebra A_h enjoys the conditions of the Van den Bergh duality theorem and the corresponding dualizing module is determined by an outer automorphism of A_h intrinsic to A_h. We show how this automorphism can be expressed in terms of the modular class of the corresponding Poisson variety. We also prove that the Van den Bergh dualizing module of the deformation quantization algebra A_h is free if and only if the corresponding Poisson structure is unimodular.