We report a first-principle study of the E(1) defect in alpha-quartz and of the analogous E'(gamma) defect in amorphous SiO2. Our calculation supports the attribution of both these defects to a positively charged oxygen vacancy. The ground-state configuration of these defects is characterized by a large local relaxation of the atomic network, which leads to a localization of the unpaired electron on a Si dangling bond. Using the calculated electronic spin densities, we fully characterize the hyperfine interactions with nearby Si-29. Our results explain well both the strong and the weak features that are observed in the experimental spectra.