This article deals with the characterization, using an acoustic technique, of the mechanical behavior of a dry dense granular medium under quasistatic loading. Ultrasound propagation through the contact-force network supporting the external load offers a noninvasive probe of the viscoelastic properties of such heterogeneous media. First the response of a glass bead packing is studied in an oedometric configuration during creep and relaxation tests. Quasilogarithmic increases of sound velocities are found in both mechanical tests. A model based on the mechanics of microcontacts between rough grains adequately reproduces our experimental results, especially for the evolution of elastic modulus. Another main experimental finding is that collective grain rearrangements within the packing also play a crucial role at the early stage of creep and relaxation.