The impact of depressive mood and cognitive impairment on quality of life of the elderly