Hurricane Beryl maintained its Category 4 strength as it brushed the coast of Jamaica on Wednesday afternoon.