Viscoelasticity of granular materials