Multicomponent Bell inequality and its violation for continuous-variable systems