Teenagers who play video games are more likely to get better grades at school, a study has found.