Simultaneous Monte Carlo analysis of parton densities and fragmentation functions