Contextual Experience Replay for Self-Improvement of Language Agents