Origin of W UMa-type contact binaries - age and orbital evolution