Lithium abundance in the globular cluster M4: from the turn-off to the red giant branch bump