We investigate the possibility of constraining the ionization state of the intergalactic medium (IGM) close to the end of reionization (z ~ 6) by measuring the size of the HII regions in high-z quasars spectra. We perform a combination of multiphase smoothed particle hydrodynamics (SPH) and 3D radiative transfer (RT) simulations to reliably predict the properties of typical high-z quasar HII regions, embedded in a partly neutral IGM (x_HI=0.1). In this work we assume a fixed configuration for the quasar lifetime and luminosity, i.e. t_Q=10^7 yr and N_gamma=5.2 10^56 s-1. From the analysis of mock spectra along lines of sight through the simulated QSO environment, we find that the HII region size derived from quasar spectra is on average 30 per cent smaller than the physical one. Additional maximum likelihood analysis shows that this offset induces an overestimate of the neutral hydrogen fraction, x_HI, by a factor of 3. By applying the same statistical method to a sample of observed QSOs our study favors a mostly ionized (x_HI < 0.06) universe at z=6.1.