Convergence of an implicit algorithm for two families of nonexpansive mappings