UK dairy processors and farmers have struck a tentative deal on a code of practice to govern relations in the sector.