A new code to govern the relationship between pub companies and their licensees has been published by three leading industry associations.