Mechanistic stochastic model of histone modification pattern formation