The velocity field of the outer Galaxy in the southern hemisphere. III - Determination of distances to O, B, and A type stars in the Walraven photometric system