Bayesian interactions and collective dynamics of opinion: Herd behavior and mimetic contagion