Cardiff City's relegation from the Premier League has been confirmed after they lost 3-0 at Newcastle United.