Workers in seaside towns earn almost £5,000 a year less than elsewhere in the country, a new study suggests.