how chronic pain affects mental health