For those facing similar issues, if you are after a real solution, read on...
MSBuild expects the property defined by itemgroup to be present inside of the target. Replacing ItemGroup tag with Createitem tag helped me to arrive at a solution. Put this in a separate target and call the target from the main target.
<target name="CopyFiles">
<createitem include="$(BuildFolder)_PublishedWebsites\**\*.*">
<output taskparameter="Include" itemname="YourFilesToCopy" />
</createitem>
<!--copy build files -->
<copy sourcefiles="@(YourFilesToCopy)">
DestinationFiles="@(YourFilesToCopy->'$(IISFolder)\%(RecursiveDir)%(Filename)%(Extension)')" />
</copy></target>