Stellar mass and age determinations - I. Grids of stellar models from Z = 0.006 to 0.04 and M = 0.5 to 3.5 M⊙