Sounds like to need to trim the back of the cabinets then. The inside back of the cabinet is not touching the wall, no? So it's just the extra bit on the cabinet sides touching, so trim these down at the back, and the worktop should meet the wall.
Deppending on: ~
How wide is the widest gap between worktop/wall?
Deppending on: ~
How wide is the widest gap between worktop/wall?