Gender segregation in the workforce and the role of worker preferences