Spanish energy minister aims to get climate law agreed by year-end