We report a Ba nuclear quadrupole resonance (NQR) study of the antiferromagnetic state of YBa2Cu3O6.05 (Neel temperature T-N = 415 K) performed between 16 and 402 K. The Zeeman perturbed Ba-137 NQR spectrum yields information on two hyperfine fields present at the Ba site: the electric field gradient (EFG) and the internal magnetic field arising from the Cu(2) sublattice magnetization. The absolute value of the EFG is in remarkable agreement with cluster and band structure calculations thus demonstrating again that both methods provide a satisfying electronic bond picture for the Y-Ba-Cu-O compounds [except for the planar Cu(2) site]. The temperature dependence of the EFG arises from thermal expansion only. The internal field, B(T), has been deduced from the modulation of the Ba spin-echo intensity. A calculation of the dipolar field at the Ba site produced by Cu(2) d electrons yields a value that is about three times larger than the experimental result. The discrepancy could be explained by assuming that part of the magnetic moment is located at oxygen ions. The temperature variation of B(T) follows, up to 402 K, a power law [B(0)-B(T)]/B(0)=AT(alpha) with alpha=1.82(22) which agrees quite well with the result of a Cu(2) in-plane determination of the sublattice magnetization. Furthermore, this result is in accord with a spin-wave model for a quasi-two-dimensional (2D) antiferromagnet. The ''critical exponent'' beta is estimated to be less than or equal to 0.18 which is in accord with values proposed by models for 2D ordered magnetic systems. Thus YBa2Cu3O6.05 behaves, in terms of its spin dynamics, as a quasi-2D antiferromagnet and this character can be studied either at out-of-plane Ba or at in-plane Cu(2) sites.