The Role of Artificial Intelligence in Democracy: Opportunities and Risks