The high-profile attendance of the leaders of Apple and Google at a Chinese conference promoting Beijing’s vision of a censored internet highlights the dilemma for Western tech companies trying to expand in an increasingly lucrative but restricted market.