Nonuniform metallic state in manganites and cuprates