Majority versus minority dynamics: Phase transition in an interacting two-state spin system