Primary school children who spend a lot of time on screens perform worse in reading and maths tests, a new study suggests.