An inverse problem in the theory of materials with memory