Contact matrices for multipopulation epidemic models: how to build a consistent matrix close to data?