The distance of M 33 and the stellar population in its outskirts