Media exposure is a central concept in understanding the dynamics of public opinion and political change. Traditional models of media exposure have been severely challenged by the shift to online news consumption and news-sharing on social media. Here we use network analysis and automated content analysis to examine the interaction between news media and social media around the UK General Election in 2015. We study a large corpus of UK newspaper articles and Twitter content, finding significant temporal correlations between newspaper topic coverage and the content discussed on Twitter. We also identify news-sharing communities around groups of news sources that are ideologically clustered. Analysis of topics covered within each group shows that different communities are exposed to different news content during the election. Our results confirm that ideological bias and selective news-sharing affect patterns of online media exposure in social media.