Cellular automata model for a contact problem