In-context denoising with one-layer transformers: connections between attention and associative memory retrieval