How to level an existing wall
This answer assumes the countertop doesn't have an integral (pre-formed) back splash.   In order to move the countertop back to have the entire edge touching the wall you will need to scribe a line.  To scribe a cut line you must first get a scribe. This is nothing more than a compass, but one leg has a holder for a pencil ( the other leg is pointed).  To use it first orient the countertop so it is square to the cabinet bottoms. Depending where the gap(s) are located you must now find the space furthest from the back edge. This is the distance to set the compass too (the space between the pencil and the pointed leg). Tighten the nut so it remains at this setting.   Be certain to secure the countertop so it doesn't move (clamps or screws). Next, with the pointed leg against the wall and the penciled leg on the countertop angle the compass slightly(so you are pulling it) and pull it from one side of the countertop to the other. Keep both legs against their respective surface.  If all has gone well you should see a pencil line that tapers when compared to the back edge of the countertop. This is your cut line. Removing it will allow the countertop to fully contact the wall.   Check This First If you have a countertop that has a lip or bull-nosed front edge be sure the amount that you need to remove isn't so much that the lip prevents it from touching the wall.